<script type="application/javascript">
    $('.msg_top li').click(function () {
        $('.msg_top li').removeClass('click_bottom');
        $(this).addClass('click_bottom');
    })
</script>
<div class="msg_top">
    <ul>
        <li ><a class="cl_a" href="{{url('section_list')}}/section={{$section_id}}/all">全部</a></li>
        <li><a class="cl_a" href="{{url('section_list')}}/section={{$section_id}}/best">精华</a></li>
        <li><a class="cl_a" href="{{url('section_list')}}/section={{$section_id}}/reply">评论</a></li>
        <li><a class="cl_a" href="{{url('section_list')}}/section={{$section_id}}/vote">点赞</a></li>
        <li><a class="cl_a" href="{{url('section_list')}}/section={{$section_id}}/time">时间</a></li>
    </ul>
</div>
<ul class="msg">
    @foreach($data as $a)
        <li>
            <div class="topic_avatar">
                <a href="{{url('userCenter')}}/user={{$a->user_id}}"><img title="{{$a->user['username']}}" src="{{asset($a->profile['avatar'])}}" ></a>
            </div>
            <div class="topic_title">
                <a class="li_a" href="{{url('topic')}}/topics={{$a->id}}">
                    <span>{{$a->tags[0]['tag_name']}}</span>
                    <i title="{{$a->title}}">{{$a->title}}</i>
                    <p>{{count($a->replies)}}评/{{count($a->vote)}}赞/{{$a->created_at->diffForHumans()}}</p>
                </a>
            </div>
        </li>
    @endforeach
</ul>
<div class="d_a">
    <a href="javascript:void(0)" onclick="page(1)">首页</a>
    <a href="javascript:void(0)" onclick="page(<?php echo $prev ?>)">上一页</a>
    @foreach($pp as $key=>$val)
        @if($val == $page)
            <span>{{$val}}</span>
        @else
            <a href="javascript:void(0)" onclick="page({{$val}})">{{$val}}</a>
        @endif
    @endforeach
    <a href="javascript:void(0)" onclick="page(<?php echo $next ?>)">下一页</a>
    <a href="javascript:void(0)" onclick="page(<?php echo $sums ?>)">尾页</a><br />
</div>
